/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package switchs;

/**
 *
 * @author c0220909
 */
public class Principal {

    enum Color {

            red, green, blue //Porque no puede ir dentro del main?
        }
    public static void main(String[] args) {
        int x = 3;
        switch (x) {
            case 1:
                System.out.println("x is equal to 1");
                break;
            case 2:
                System.out.println("x is equal to 2");
                break;
            case 3:
                System.out.println("x is equal to 3");
                break;
            default:
                System.out.println("Still no idea what x is");
        }
        //
        String s = "xyz";
        switch (s.length()) {
            case 1:
                System.out.println("length is one");
                break;
            case 2:
                System.out.println("length is two");
                break;
            case 3:
                System.out.println("length is three");
                break;
            default:
                System.out.println("no match");
        }
        //final int a = 1;
        // final int b;
        // b = 2;
        // int x = 0;
        // switch (x) {
        //     case a: // ok
        //     case b: // compiler error

       
        Color c = Color.green;
        switch (c) {
            case red:
                System.out.print("red ");
            case green:
                System.out.print("green ");
            case blue:
                System.out.print("blue ");
            default:
                System.out.println("done");
        }
   } 
        
}